﻿using System;
using System.Collections.Generic;
using System.Web;
using NhanAi.App_Code;
using System.Threading;
using System.Globalization;
using System.Web.UI;
namespace NhanAi.Public
{
    public class PublicBasePage:System.Web.UI.Page
    {
        protected override void InitializeCulture()
        {
           // base.InitializeCulture();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(CurrentLanguage);
           // Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(CurrentLanguage);
        }
        public string CurrentLanguage
        {
            get {return Session["language"] == null ? "vi" : Session["language"].ToString(); }
        }
        public int CurrentLanguageCode
        {
            get { if (Session["language"] == null)return NAConstants.LANGUAGE_VI;
            if (Session["language"].ToString() == "en") return NAConstants.LANGUAGE_EN;
            else return NAConstants.LANGUAGE_VI;
            }
        }
        public bool IsEnglish() { return Session["language"].ToString() == "en"; }
        protected void Authenticate()
        {
            if (Session["user"] == null) Response.Redirect("/Public/Login.aspx");
        }
    }
    
}